import 'package:flutter/material.dart';
import 'package:flutter_shop/pages/base/base_state.dart';
import 'package:flutter_shop/pages/cart/cart_tab_page/entity/cart_goods_data.dart';
import 'package:flutter_shop/pages/cart/order_confirm/order_confirm_contract.dart';
import 'package:flutter_shop/pages/cart/order_confirm/order_confirm_presenter.dart';
import 'package:flutter_shop/pages/cart/order_confirm/widget/bottom_confirm.dart';
import 'package:flutter_shop/pages/cart/order_confirm/widget/order_info.dart';
import 'package:flutter_shop/widget/common_app_bar.dart';

/// Title:订单确认页 <br/>
/// Description: <br/>
/// author:xiemiao <br/>
/// date: 2020-03-09  <br/>
/// version 1.0 <br/>
class OrderConfirmPage extends StatefulWidget {
  final List<CartGoodsData> list;

  OrderConfirmPage({Key key, this.list}) : super(key: key);

  @override
  _OrderConfirmPageState createState() => _OrderConfirmPageState();
}

class _OrderConfirmPageState extends BaseState<OrderConfirmPage, OrderConfirmPresenter> implements OrderConfirmView {
  @override
  OrderConfirmPresenter createPresenter() => OrderConfirmPresenter();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CommonAppBar("订单确认"),
      body: Container(
        child: Column(
          children: <Widget>[
            Expanded(
              child: SingleChildScrollView(
                child: OrderInfo(list: widget.list),
              ),
            ),
            BottomConfirm(list: widget.list),
          ],
        ),
      ),
    );
  }
}
